package demo1;

public class OuterClass {
    public int data1 = 1;
    private int data2 = 2;
    public static int data3 = 3;

    public void test() {
        System.out.println("out::test()方法");
    }

     class InnerClass {

        public int data1 = 50;
        public int data4 = 4;
        public static int data5 = 5;

        public void func() {
            //访问外部 data1
            System.out.println(OuterClass.this.data1);

            System.out.println("==========");
            //访问内部类 data1
            System.out.println(data1);
            System.out.println(data2);
            System.out.println(data3);
            System.out.println(data4);
            System.out.println(data5);
            System.out.println("inner::func()方法");

        }
    }
}
